// 简单的用户状态管理
import { reactive } from 'vue'

export const userStore = reactive({
  currentUser: {
    id: 1,
    username: 'admin',
    role: 'ADMIN'
  },
  
  users: [
    { id: 1, username: 'admin', role: 'ADMIN' },
    { id: 2, username: 'user1', role: 'USER' },
    { id: 3, username: 'user2', role: 'USER' }
  ],
  
  setCurrentUser(user) {
    this.currentUser = user
  },
  
  getCurrentUserId() {
    return this.currentUser.id
  }
})
